package com.xm.xm.undercover.utils

import android.content.Intent
import android.util.Log
import org.java_websocket.client.WebSocketClient
import org.java_websocket.drafts.Draft_6455
import org.java_websocket.handshake.ServerHandshake
import java.net.URI

open class JWebSocketClient(serverUri: URI) : WebSocketClient(serverUri, Draft_6455()) {

    val readMes = ReadMessage()

    override fun onOpen(handshakedata: ServerHandshake) {
        Log.d("socket", "onOpen()")
    }

    override fun onMessage(message: String) {
        Log.d("socket", message)
    }

    override fun onClose(code: Int, reason: String, remote: Boolean) {
        Log.d("socket", "onClose()")
    }

    override fun onError(ex: Exception) {
        Log.d("socket", "onError()")
    }
}